// import zhCn from './locale/zh-cn.json'
// import en from './locale/en.json'
import elZhCn from 'element-plus/es/locale/lang/zh-cn'
import { createI18n } from 'vue-i18n'
// import elEn from 'element-plus/es/locale/lang/en'
import { localeLocal } from '@/storage/local'

export enum Lang {
  ZhCn = 'zh-cn',
  En = 'en',
}

export const i18nInstance = createI18n({
  locale: localeLocal.getOrDefault(Lang.ZhCn),
  silentTranslationWarn: true,
  messages: {
    // [Lang.ZhCn]: zhCn,
    // [Lang.En]: en,
  },
})

/**
 * element plus的语言包
 *
 * @returns
 */
export function getElLocale() {
  // switch (localeLocal.get()) {
  //   case Lang.En:
  //     return elEn
  //   default:
  //     return elZhCn
  // }
  return elZhCn
}

export default i18nInstance.global
